package com.mazong.serverescc.pojo;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Data
@NoArgsConstructor
@Document(indexName = "article", type = "_doc", shards = 1, replicas = 0)
public class TbArticle {

    @Id
    private Long id;

    @Field(type = FieldType.Keyword)
    private String firstTag;

    @Field(type = FieldType.Keyword)
    private String secondTag;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String content;

    @Field(type = FieldType.Integer)
    private Integer type;

    public TbArticle(Long id, String firstTag, String secondTag, String content, Integer type) {
        this.id = id;
        this.firstTag = firstTag;
        this.secondTag = secondTag;
        this.content = content;
        this.type = type;
    }
}
